﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Excel与DataTable互操作示例-----楚旋博客园http://eflylab.cnblogs.com</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table width="640" border="1" cellpadding="1">
     <tr>
            <td colspan="3" align="center">
                Excel与DataTable 互操作示例
            </td>
            </tr>
        <tr>
            <td colspan="3"><asp:Button runat="server" ID="btnLoadDt" Text="生成DataTable" OnClick="btnLoadDt_Click" /></td>
        </tr>
         <tr>
            <td>DataTable导入Excel：</td>
            <td><asp:TextBox ID="txtExcelPath" Text="C:/DataTableToExcel.xls" runat="server"></asp:TextBox></td>
            <td><asp:Button ID="btnExportExcel" runat="server"  Text="DataTable导出Excel" OnClick="btnExportExcel_Click" /></td>
        </tr>
        <tr>
            <td>Excel导入DataTable：</td>
            <td><asp:TextBox ID="txtFromExcel" Text="C:/DataTableToExcel.xls" runat="server"></asp:TextBox> </td>
            <td><asp:Button ID="btnExcelToDataTable" runat="server"  Text="Excel导入DataTable" OnClick="btnExcelToDataTable_Click" /></td>
        </tr>
        <tr>
            <td colspan="3">
            <asp:Repeater ID="repData" runat="server">
            
            <HeaderTemplate>
                <table border="1" width="640"> <tr><td width="75%">用户名</td><td>姓别</td>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                <td><%#Eval("userName") %></td>
                <Td><%#Eval("userSex") %></Td> 
                </tr>
            </ItemTemplate>
            <FooterTemplate>
            </tr></table>
            </FooterTemplate>
        </asp:Repeater>
        </td>
        </tr>
    </table>
  <asp:Button runat="server" ID="qaaaaa" Text="生成DataTable"/>
        
    </div>
    </form>
</body>
</html>
